package com.tydic.daily.user.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tydic.daily.dao.DailyPermissionMapper;
import com.tydic.daily.dao.DailyUserMapper;
import com.tydic.daily.user.po.DailyUser;
import com.tydic.daily.user.service.UserLoginService;

@Service
public class UserLoginServiceImpl implements UserLoginService {

	@Autowired
	DailyUserMapper dailyUserMapper;
	@Autowired
	DailyPermissionMapper dailyPermissionMapper;

	@Override
	public int registUser(DailyUser record) {
		return dailyUserMapper.insertSelective(record);
	}

	@Override
	public int getValidForRegistUsername(String userName) {
		int validForRegistUsername = dailyUserMapper.getValidForRegistUsername(userName);
		return validForRegistUsername;
	}

	@Override
	public DailyUser queryUserByName(String userName) {
		return dailyUserMapper.queryUserByName(userName);
	}

	@Override
	public List<String> getPermissionByUserId(Integer userId) {
		return dailyPermissionMapper.getPermissionByUserId(userId);
	}
	
}